Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat[CL]: add num initialized ticks query #6416

Merged
merged 8 commits into from
Sep 15, 2023

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented Sep 15, 2023

Closes: #XXX

What is the purpose of the change

We currently have a LiquidityNetInDirection query, which allows us to provide a start and end tick, traverse this range, and return the liquidity net. The unknown here is how many initialized ticks actually exist in this range.

For purposes of understanding the impact a swap will have on the current sqrt price, it's helpful to request the next X initialized ticks and return their liquidity depths, regaurdless of how many ticks need to be traversed to get to X.

Testing and Verifying

TBD

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@czarcas7ic czarcas7ic added V:state/compatible/backport State machine compatible PR, should be backported A:backport/v19.x backport patches to v19.x branch labels Sep 15, 2023
@czarcas7ic
Copy link
Member Author

devbot help

@devbot-wizard
Copy link
Collaborator

Hi! I'm DevBot, a bot that helps with common tasks in the development process. Commands:

  • devbot fix: Fix basic errors in the PR. (e.g. imports, changelog conflicts, go mod conflicts)
  • devbot merge base: Merge the base branch into the PR branch.
  • devbot add changelog [misc/feat/bug/api/sec] [message]: Add a changelog entry to the PR. (e.g. devbot add changelog feat Added a new feature)
    • If message is blank, defaults to PR title.
  • devbot re-pr: Re-PR the PR, useful for external contributors where we have no edit perms.

@czarcas7ic
Copy link
Member Author

devbot add changelog feat

@czarcas7ic czarcas7ic marked this pull request as ready for review September 15, 2023 19:51
Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


liquidityDepths := []queryproto.TickLiquidityNet{}

iterationCount := uint64(0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, iterationCount refers to the user provided literation limit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, mistook this for the Go-side limit we discussed before

@czarcas7ic czarcas7ic merged commit 9f664d7 into main Sep 15, 2023
1 check passed
@czarcas7ic czarcas7ic deleted the adam/add-num-initialized-ticks-query branch September 15, 2023 20:55
mergify bot pushed a commit that referenced this pull request Sep 15, 2023
* add num initialized ticks query

* update changelog

* Generated protofile changes

* add max number of initialized ticks to return

* Generated protofile changes

* remove limit

* update query.yml

* add go test

---------

Co-authored-by: devbot-wizard <141283918+devbot-wizard@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
(cherry picked from commit 9f664d7)

# Conflicts:
#	CHANGELOG.md
#	x/concentrated-liquidity/client/queryproto/query.pb.go
czarcas7ic added a commit that referenced this pull request Sep 15, 2023
* feat[CL]: add num initialized ticks query (#6416)

* add num initialized ticks query

* update changelog

* Generated protofile changes

* add max number of initialized ticks to return

* Generated protofile changes

* remove limit

* update query.yml

* add go test

---------

Co-authored-by: devbot-wizard <141283918+devbot-wizard@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
(cherry picked from commit 9f664d7)

# Conflicts:
#	CHANGELOG.md
#	x/concentrated-liquidity/client/queryproto/query.pb.go

* Generated protofile changes

* Update CHANGELOG.md

* fix merge conflicts

---------

Co-authored-by: Adam Tucker <adam@osmosis.team>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
@github-actions github-actions bot mentioned this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v19.x backport patches to v19.x branch C:CLI C:x/concentrated-liquidity V:state/compatible/backport State machine compatible PR, should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants